<template>
  <div id="app">
    <div @click="weekOpen" class="week">{{week}}</div>
    <el-dialog
        title="提示"
        :visible.sync="dialogVisible"
        width="30%"
        :before-close="handleClose">
        <SelectionWeek ref="weekRef" @getWeek="acquisitionWeek"/>
        <span slot="footer" class="dialog-footer">
          <el-button @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="primary">确 定</el-button>
        </span>
    </el-dialog>  
    
  </div>
</template>

<script>
import SelectionWeek from './components/SelectionWeek.vue'

export default {
  name: 'App',
  components: {
    SelectionWeek
  },
  data() {
    return {
      dialogVisible:false,
      week:"请选择周"
    };
  },

  mounted() {
    
  },

  methods: {
    weekOpen(){
      this.dialogVisible = true
    },
    handleClose(done) {
        this.$confirm('确认关闭？')
          .then(() => {
            done();
          })
          .catch(() => {});
      },

      primary(){
        this.dialogVisible = false
        this.$refs.weekRef.clearWeek()
      },
      acquisitionWeek(val){
        this.week = val
      }
  },
}
</script>

<style>
#app {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
.week{
  margin-top: 300px;
width: 100%;
height: 100%;
background-color: black;
color: #fff;
text-align: center;
line-height: 100px;
}
</style>
